package com.yf.exam.modules.trainingarchives.teacherplanexecution.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yf.exam.core.api.dto.PagingReqDTO;
import com.yf.exam.modules.trainingarchives.organization.dto.OrganizationDTO;
import com.yf.exam.modules.trainingarchives.pdfexport.dto.second.TeachingPlanExportDTO;
import com.yf.exam.modules.trainingarchives.teacherplanexecution.dto.TeachingPlanExecutionDTO;
import com.yf.exam.modules.trainingarchives.teacherplanexecution.entity.TeachingPlanExecution;
import com.yf.exam.modules.trainingarchives.teacherplanexecution.mapper.TeachingPlanExecutionMapper;
import com.yf.exam.modules.trainingarchives.teacherplanexecution.service.ITeachingPlanExecutionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yf.exam.modules.trainingarchives.teacherplanexecution.vo.TeachingPlanExecutionListVO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 教学计划执行表 服务实现类
 * </p>
 *
 * @author author
 * @since 2024-12-29
 */
@Service
public class TeachingPlanExecutionServiceImpl extends ServiceImpl<TeachingPlanExecutionMapper, TeachingPlanExecution> implements ITeachingPlanExecutionService {

    @Override
    public void add(TeachingPlanExecutionDTO reqDTO) {
        TeachingPlanExecution teachingPlanExecution = new TeachingPlanExecution();
        BeanUtils.copyProperties(reqDTO,teachingPlanExecution);
        this.save(teachingPlanExecution);
    }

    @Override
    public void update(TeachingPlanExecutionDTO reqDTO) {
        TeachingPlanExecution teachingPlanExecution = new TeachingPlanExecution();
        BeanUtils.copyProperties(reqDTO,teachingPlanExecution);
        this.updateById(teachingPlanExecution);
    }

    @Override
    public IPage<TeachingPlanExecutionListVO> paging(PagingReqDTO<TeachingPlanExecutionDTO> reqDTO) {
        return baseMapper.paging(reqDTO.toPage(),reqDTO.getParams());
    }

    @Override
    public List<TeachingPlanExportDTO> getTeachingPlanPdfData(String trainingClassInfoId) {
        return baseMapper.getTeachingPlanPdfData(trainingClassInfoId);
    }


}
